(function() { var origOpen = XMLHttpRequest.prototype.open; XMLHttpRequest.prototype.open = function() { this.addEventListener('load', function() { // console.log('request completed!'); // console.log(this.readyState); //will always be 4 (ajax is completed successfully) var response = ""; if(typeof response.responseText != 'undefined') { var response = JSON.parse(this.responseText); if(typeof response.redirect != 'undefined') { // console.log(typeof response.redirect); window.location = response.redirect; } } }); origOpen.apply(this, arguments); }; })(); function changeColor(color, ID) { document.getElementById(ID).bgColor = "#" + color; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i' menu2[11]='Call Forwarding' menu2[12]='Ring Groups' menu2[13]='Callback' menu2[14]='DISA' menu2[15]='Time Conditions' menu2[16]='CallerID Filtering' menu2[17]='Phone Book' menu2[18]='e911' //Sub Accounts var menu3=new Array() menu3[0]='Create Sub Account' menu3[1]='Manage Sub Accounts' menu3[2]='Sub Accounts Report' menu3[3]='Sub Accounts Registrations' // CDR Menu var menu4=new Array() menu4[0]='Call Detail Records' menu4[1]='Printable CDR' menu4[2]='CSV/XLS/XML/SQL CDR' menu4[3]='Graphical Usage Report' menu4[4]='Sub Accounts Report' menu4[5]='Account Statistics' // Finances var menu6=new Array() menu6[0]='Account Balance' menu6[1]='Add Funds' menu6[2]='Transactions History' menu6[3]='Generate Invoice' menu6[4]='Canadian Invoice' menu6[5]='DID billing' // Support var menu7=new Array() menu7[0]='New Ticket' menu7[1]='View Tickets' menu7[2]='Configuration Samples' menu7[3]='Account Information' menu7[4]='Feature Requests' menu7[5]='VoIP.ms Wiki' // Rates var menu8=new Array() menu8[0]='Check Rates online' menu8[1]='CSV File Generator' menu8[2]='Excel File Generator' menu8[3]='SQL File Generator' menu8[4]='XML Format' // Rates var menu9=new Array() menu9[0]='Reseller Main' menu9[1]='Client Branding & Access' menu9[2]='Manage Client\'s Accounts' menu9[3]='Manage Rates & Packages' menu9[4]='Reports' menu9[5]='SOAP and REST/JSON API' var menuwidth='255px' //default menu width var menubgcolor='#666F6E' //menu bgcolor var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds) var hidemenu_onclick="yes" //hide menu when user clicks within menu? /////No further editting needed var ie4=document.all var ns6=document.getElementById && !document.all if (ie4||ns6) { $(document).ready(function() { $('body').prepend(''); }); } function getposOffset(what, offsettype){ var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop; var parentEl=what.offsetParent; while (parentEl!=null){ totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop; parentEl=parentEl.offsetParent; } return totaloffset; } function showhide(obj, e, visible, hidden, menuwidth){ if (ie4||ns6) dropmenuobj.style.left=dropmenuobj.style.top="-500px" if (menuwidth!=""){ dropmenuobj.widthobj=dropmenuobj.style dropmenuobj.widthobj.width=menuwidth } if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover") obj.visibility=visible else if (e.type=="click") obj.visibility=hidden } function iecompattest(){ return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body } function clearbrowseredge(obj, whichedge){ var edgeoffset=0 if (whichedge=="rightedge"){ var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15 dropmenuobj.contentmeasure=dropmenuobj.offsetWidth if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure) edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth } else{ var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18 dropmenuobj.contentmeasure=dropmenuobj.offsetHeight if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up? edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight if ((dropmenuobj.y-topedge) 0){ (function( $ ) { $.widget( "custom.combobox", { _create: function() { this.wrapper = $( "" ) .addClass( "custom-combobox" ) .insertAfter( this.element ); this.element.hide(); this._createAutocomplete(); this._createShowAllButton(); }, _createAutocomplete: function() { var selected = this.element.children( ":selected" ), value = selected.val() ? selected.text() : ""; this.input = $( "" ) .appendTo( this.wrapper ) .val( value ) .attr( "title", "" ) .addClass( "custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left" ) .autocomplete({ delay: 0, minLength: 0, source: $.proxy( this, "_source" ) }) .tooltip({ tooltipClass: "ui-state-highlight" }); this._on( this.input, { autocompleteselect: function( event, ui ) { ui.item.option.selected = true; this._trigger( "select", event, { item: ui.item.option }); }, autocompletechange: "_removeIfInvalid" }); }, _createShowAllButton: function() { var input = this.input, wasOpen = false; $( "" ) .attr( "tabIndex", -1 ) .attr( "title", "Show All Items" ) .tooltip() .appendTo( this.wrapper ) .button({ icons: { primary: "ui-icon-triangle-1-s" }, text: false }) .removeClass( "ui-corner-all" ) .addClass( "custom-combobox-toggle ui-corner-right" ) .mousedown(function() { wasOpen = input.autocomplete( "widget" ).is( ":visible" ); }) .click(function() { input.focus(); // Close if already visible if ( wasOpen ) { return; } // Pass empty string as value to search for, displaying all results input.autocomplete( "search", "" ); }); }, _source: function( request, response ) { var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" ); response( this.element.children( "option" ).map(function() { var text = $( this ).text(); if ( this.value && ( !request.term || matcher.test(text) ) ) return { label: text, value: text, option: this }; }) ); }, _removeIfInvalid: function( event, ui ) { // Selected an item, nothing to do if ( ui.item ) { return; } // Search for a match (case-insensitive) var value = this.input.val(), valueLowerCase = value.toLowerCase(), valid = false; this.element.children( "option" ).each(function() { if ( $( this ).text().toLowerCase() === valueLowerCase ) { this.selected = valid = true; return false; } }); // Found a match, nothing to do if ( valid ) { return; } // Remove invalid value this.input .val( "" ) .attr( "title", value + " didn't match any item" ) .tooltip( "open" ); this.element.val( "" ); this._delay(function() { this.input.tooltip( "close" ).attr( "title", "" ); }, 2500 ); this.input.autocomplete( "instance" ).term = ""; }, _destroy: function() { this.wrapper.remove(); this.element.show(); } }); })( jQuery ); $(function() { if($( "select#col_state" ).length > 0){ $( "select#col_state" ).combobox(); } }); }